package demon4;



public class Test {
    public static void walk(IRunning iRun) {
        iRun.run();
    }
    public static void swim(ISwimming iSwimming) {
        iSwimming.swim();
    }
    public static void fly(IFlying iFlying) {
        iFlying.fly();
    }


    public static void main(String[] args) {
        Dog dog = new Dog("旺财", 17);
        dog.eat();
        dog.fly();
        dog.swim();
        walk(new Dog("xiaohu", 3));
        Fish fish = new Fish("小鱼儿", 2);
        fish.eat();
        fish.fly();
        fish.swim();
        fly(new Dog("xiaohua", 3));
        fly(new Fish("xiaoyu", 3));

    }
}
